package shiyan10;

import java.util.Scanner;

class IllegalScoreException extends Exception{
	public IllegalScoreException(){
		super();
	}
}
class IllegalNameException extends Exception{
	public IllegalNameException(){
		super();
	}
}
class Student{
	private String name;
	private int score;
	public Student(String name, int score) {
		this.name=name;
		this.score=score;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) throws IllegalNameException{
		char c;
		c=name.charAt(0);
		if(c>='0'&&c<='9'){
			throw new IllegalNameException();
		}
		this.name = name;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public int addScore(int score)throws IllegalScoreException{
		int s=0;
		if(score<0||score>100){
			throw new IllegalScoreException();
		}
		else
			s=score;
		return s;
	}
	@Override
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}
	
}

public class Sy101{

	public static void main(String[] args) throws IllegalNameException,IllegalScoreException{
		Scanner input = new Scanner(System.in);
		while (input.hasNext()) {
			String str = input.next();
			if (str.equals("new")) {
				Student stu = new Student(input.next(), input.nextInt());
				try {
					stu.setName(stu.getName());
					stu.addScore(stu.getScore());
					System.out.println(stu);
				} catch (IllegalNameException e1) {
					System.out.println(e1+": the first char of name must not be digit, name="+stu.getName());
				} catch (IllegalScoreException e2) {
					System.out.println(e2+": score out of range, score="+stu.getScore());
				}
			}
		}
		input.close();
		System.out.println("scanner closed");
	}
}